cmake_minimum_required(VERSION 3.22)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

project(IESample LANGUAGES CXX)

set(Common_DIR ${CMAKE_SOURCE_DIR}/sample/Common)
set(Interface_DIR ${CMAKE_SOURCE_DIR}/sample/Interface)

include_directories(${Common_DIR})
include_directories(${Interface_DIR})

find_package(Qt5 COMPONENTS Widgets LinguistTools REQUIRED)
find_package(OpenCASCADE REQUIRED)
include_directories(${OpenCASCADE_INCLUDE_DIR})

file(GLOB_RECURSE Common_SRC ${Common_DIR}/*.cpp)
file(GLOB_RECURSE Interface_SRC ${Interface_DIR}/*.cpp)
list(APPEND IESample_SRC ${Common_SRC} ${Interface_SRC})

file(GLOB_RECURSE Common_TS ${Common_DIR}/*.ts)
file(GLOB_RECURSE Interface_TS ${Interface_DIR}/*.ts)
list(APPEND TS_FILES ${Common_TS} ${Interface_TS})

#message(RES_DIR: $ENV{CSF_RESOURCESDEFAULTS})
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION $ENV{CSF_RESOURCESDEFAULTS})
qt5_add_translation(QM_FILES ${TS_FILES})


add_executable(IESample
  IESample.cpp
  ${IESample_SRC}
)

target_link_libraries(IESample PRIVATE
    ${OpenCASCADE_LIBRARIES}
    Qt5::Widgets)

